import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";
import { Menu } from "@/views/app/wechat/menus/interface/index";

const baseUrl = PORT1 + "/wechat";

// 获取素材列表
export const suCaiList = (
  params: { type: "news" | "video" | "image" | "voice"; offset: number; count: number } = { type: "image", offset: 0, count: 20 }
) => {
  return http.post(baseUrl + "/sucai/list", params);
};

// 获取草稿素材
export const draftList = (
  params: { no_content: 0 | 1; offset: number; count: number } = { no_content: 0, offset: 0, count: 20 }
) => {
  return http.post(baseUrl + "/sucai/draft", params);
};

// 获取素材计算总数
export const sucaiCount = () => {
  return http.get(baseUrl + "/sucai/count");
};

// 获取素材计算总数
export const sucaiDraftCount = () => {
  return http.get(baseUrl + "/sucai/draft_count");
};

// 创建自定义菜单
export const createMenu = (params: Menu) => {
  return http.post(baseUrl + "/menu/add", params);
};

export const getMenu = () => {
  return http.get(baseUrl + "/menu/list");
};

// 关注是回复设置
export const SetSubScribeReply = (params: any) => {
  return http.post(baseUrl + "/auto_reply/subscribe/update", params);
};

// 获取回复
export const GetSubscribeReply = () => {
  return http.get(baseUrl + "/auto_reply/subscribe/info");
};

// 获取模板id
export const getTemplateList = () => {
  return http.get(baseUrl + "/template/list");
};
